package com.esri.core.internal.value;

import java.util.EnumSet;
import java.util.Iterator;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class KMLFeatureInfo {
    int a;
    FEATURETYPE b;

    /* loaded from: classes.dex */
    public enum FEATURETYPE {
        FOLDER("Folder"),
        GROUND_OVERLAY("GroundOverlay"),
        LINE("esriGeometryPolyline"),
        NETWORK_LINK("NetworkLink"),
        POINT("esriGeometryPoint"),
        POLYGON("esriGeometryPolygon"),
        SCREEN_OVERLAY("ScreenOverlay");
        
        private String a;

        FEATURETYPE(String str) {
            this.a = str;
        }

        public static FEATURETYPE fromString(String str) {
            Iterator it = EnumSet.allOf(FEATURETYPE.class).iterator();
            while (it.hasNext()) {
                FEATURETYPE featuretype = (FEATURETYPE) it.next();
                if (featuretype.a.equals(str)) {
                    return featuretype;
                }
            }
            return null;
        }
    }

    private KMLFeatureInfo() {
        this.a = -1;
    }

    public KMLFeatureInfo(FEATURETYPE featuretype, int i) {
        this.a = -1;
        this.b = featuretype;
        this.a = i;
    }

    public int a() {
        return this.a;
    }

    public FEATURETYPE b() {
        return this.b;
    }

    public static KMLFeatureInfo a(JsonParser jsonParser) throws Exception {
        if (com.esri.core.internal.util.d.c(jsonParser)) {
            KMLFeatureInfo kMLFeatureInfo = new KMLFeatureInfo();
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String currentName = jsonParser.getCurrentName();
                jsonParser.nextToken();
                if ("id".equals(currentName)) {
                    kMLFeatureInfo.a = jsonParser.getIntValue();
                } else if ("type".equals(currentName)) {
                    kMLFeatureInfo.b = FEATURETYPE.fromString(jsonParser.getText());
                } else {
                    jsonParser.skipChildren();
                }
            }
            return kMLFeatureInfo;
        }
        return null;
    }
}
